package concurrency;

import java.util.concurrent.Callable;

/**
 * 从任务中产生返回值
 *
 * @author fireway
 * @since 2019年 01月 20日 星期日 10:57:52 CST
 */
public class TaskWithResult implements Callable<String> {
    private int mId;

    public TaskWithResult(int id) {
        mId = id;
    }

    @Override
    public String call() throws Exception {
        return  "result of TaskWithResult " + mId + " in " + Thread.currentThread();
    }
}
